<%--
  Created by IntelliJ IDEA.
  User: 兰宦君
  Date: 2015/10/18
  Time: 16:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
  <title>后台管理系统——订单管理</title>
  <%@ include file="../../layout/import.jsp"%>
</head>
<body>
<%@ include file="nav.jsp"%>
<div class="container" style="min-height: 72%">
  <div class="col-sm-8 col-sm-offset-2">

    <form class="form" action="/admin/changeOrderState.do" method="post">
        <input type="hidden" name="id" value="${order.id}">
      <div class="form-group">
        <label for="date">订单日期</label>
        <label type="date" class="form-control" id="date" name="date">${order.date}</label>
      </div>
      <div class="form-group">
        <label for="payment">密码</label>
        <label type="number" class="form-control" id="payment" name="payment">${order.payment}</label>
      </div>
      <div class="form-group">
        <label for="deliver">发货人</label>
        <label type="text" class="form-control" id="deliver" name="deliver">${order.deliver}</label>
      </div>
      <div class="form-group">
        <label for="receiver">收货人</label>
        <label type="text" class="form-control" id="receiver" name="receiver">${order.receiver}</label>
      </div>

      <div class="form-group">
        <label for="address">收货地址</label>
        <label type="text" class="form-control" id="address" name="address">${order.address}</label>
      </div>
      <div class="form-group">
        <label for="phone">联系电话</label>
        <label type="number" class="form-control" id="phone" name="phone">${order.phone}</label>
      </div>
      <div class="form-group">
        <label for="postcode">邮编</label>
        <label type="number" class="form-control" id="postcode" name="postcode">${order.postcode}</label>
      </div>

        <div class="col-sm-12">
            <table class="table">
                <tr>
                    <th>图书名称</th><th>单价</th><th>数量</th>
                </tr>
                <c:forEach var="book" items="${bookList}" varStatus="i">
                    <tr>
                        <td>${book.bookname}</td>
                        <td>${book.price}</td>
                        <td>${numberList.get(i.index)}</td>
                    </tr>
                </c:forEach>
            </table>
        </div>


        <div class="form-group">
        <label for="totalprice">总价</label>
        <label type="number" class="form-control" id="totalprice" name="totalprice">${order.totalprice}</label>
      </div>

        <div class="form-group">
            <label for="state">状态</label>
            <select name="state" id="state">
                <option value="未处理" <c:if test="${order.state == '未处理'}">selected="selected" </c:if>>未处理</option>
                <option value="已发货" <c:if test="${order.state == '已发货'}">selected="selected" </c:if>>已发货</option>
                <option value="完毕" <c:if test="${order.state == '完毕'}">selected="selected" </c:if>>完毕</option>
            </select>
        </div>
      <div class="form-group col-sm-6">
          <a class="btn btn-default btn-block" href="order.do">返回</a>
      </div>
      <div class="col-sm-6">
          <input type="submit" class="form-control btn btn-primary" value="修改">
      </div>

    </form>

  </div>
</div>

<%@ include file="../footer.jsp"%>
</body>
</html>